package com.epam.dao;

import com.epam.dao.impl.HotelDAO;
import com.epam.dao.impl.PurchaseDAO;
import com.epam.dao.impl.TouristVoucherDAO;
import com.epam.dao.impl.UserDAO;
import com.epam.dao.intf.DAO;



public enum DAOFactory {
	INSTANCE;
	
	public enum DAOType {
		HOTEL, USER, PURCHASE, TOURISTVOUCHER
	}
	
	DAO dao;
	
	public DAO getDAO(DAOType type) {
		
		switch (type) {
		case HOTEL:
			dao = new HotelDAO();
			break;
		case USER:
			dao = new UserDAO();
			break;
		case PURCHASE:
			dao = new PurchaseDAO();
			break;
		case TOURISTVOUCHER:
			dao = new TouristVoucherDAO();
			break;
		}
		
		return dao;
	}
	
}

